package com.example.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;

/**
 * <h3>reqister</h3>
 * <p>资源服务器配置</p>
 *资源服务器先于主过滤器，所以还需放行主过滤器的资源
 * @author : chenjunjie
 * @date : 2021-06-24 14:31
 **/
@Configuration
@EnableResourceServer
public class ResourcesConfig extends ResourceServerConfigurerAdapter {

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/login.html","/login/**","/wx/**").permitAll()
                .anyRequest().authenticated()
        ;
    }
}
